/*
 * Class36 - Decompiled by JODE
 * Visit http://jode.sourceforge.net/
 */
public class Class36 {
	private int anInt611;
	private boolean aBoolean612 = true;
	int[] anIntArray613 = new int[2];
	int[][][] anIntArrayArrayArray614 = new int[2][2][4];
	int[][][] anIntArrayArrayArray615 = new int[2][2][4];
	int[] anIntArray616 = new int[2];
	static float[][] aFloatArrayArray617 = new float[2][8];
	static int[][] anIntArrayArray618 = new int[2][8];
	static float aFloat619;
	static int anInt620;

	private float method352(int i, int i_0_, float f, int i_1_) {
		float f_2_ = ((this).anIntArrayArrayArray615[i][0][i_1_] + f
			* (((this).anIntArrayArrayArray615[i][1][i_1_]) - ((this).anIntArrayArrayArray615[i][0][i_1_])));
		f_2_ *= 0.0015258789F;
		i_0_ = 34 / i_0_;
		return 1.0F - (float) Math.pow(10.0, (-f_2_ / 20.0F));
	}

	private float method353(float f, int i) {
		float f_3_ = 32.703197F * (float) Math.pow(2.0, f);
		if (i >= 0) {
			aBoolean612 = !aBoolean612;
		}
		return f_3_ * 3.1415927F / 11025.0F;
	}

	private float method354(int i, int i_4_, int i_5_, float f) {
		if (i_4_ != 0) {
			anInt611 = -370;
		}
		float f_6_ = ((this).anIntArrayArrayArray614[i_5_][0][i] + f
			* (((this).anIntArrayArrayArray614[i_5_][1][i]) - ((this).anIntArrayArrayArray614[i_5_][0][i])));
		f_6_ *= 1.2207031E-4F;
		return method353(f_6_, -335);
	}

	public int method355(int i, boolean bool, float f) {
		if (!bool) {
			for (int i_7_ = 1; i_7_ > 0; i_7_++) {
				/* empty */
			}
		}
		if (i == 0) {
			float f_8_ = ((this).anIntArray616[0] + ((this).anIntArray616[1] - (this).anIntArray616[0])
				* f);
			f_8_ *= 0.0030517578F;
			Class36.aFloat619 = (float) Math.pow(0.1, (f_8_ / 20.0F));
			Class36.anInt620 = (int) (Class36.aFloat619 * 65536.0F);
		}
		if ((this).anIntArray613[i] == 0) {
			return 0;
		}
		float f_9_ = method352(i, 849, f, 0);
		Class36.aFloatArrayArray617[i][0] = -2.0F * f_9_ * (float) Math.cos(method354(0, 0, i, f));
		Class36.aFloatArrayArray617[i][1] = f_9_ * f_9_;
		for (int i_10_ = 1; i_10_ < (this).anIntArray613[i]; i_10_++) {
			f_9_ = method352(i, 849, f, i_10_);
			float f_11_ = (-2.0F * f_9_ * (float) Math.cos(method354(i_10_, 0, i, f)));
			float f_12_ = f_9_ * f_9_;
			Class36.aFloatArrayArray617[i][i_10_ * 2 + 1] = Class36.aFloatArrayArray617[i][i_10_ * 2 - 1]
				* f_12_;
			Class36.aFloatArrayArray617[i][i_10_ * 2] = (Class36.aFloatArrayArray617[i][i_10_ * 2 - 1]
				* f_11_ + Class36.aFloatArrayArray617[i][i_10_ * 2 - 2] * f_12_);
			for (int i_13_ = i_10_ * 2 - 1; i_13_ >= 2; i_13_--) {
				Class36.aFloatArrayArray617[i][i_13_] += (Class36.aFloatArrayArray617[i][i_13_ - 1]
					* f_11_ + Class36.aFloatArrayArray617[i][i_13_ - 2] * f_12_);
			}
			Class36.aFloatArrayArray617[i][1] += Class36.aFloatArrayArray617[i][0] * f_11_ + f_12_;
			Class36.aFloatArrayArray617[i][0] += f_11_;
		}
		if (i == 0) {
			for (int i_14_ = 0; i_14_ < (this).anIntArray613[0] * 2; i_14_++) {
				Class36.aFloatArrayArray617[0][i_14_] *= Class36.aFloat619;
			}
		}
		for (int i_15_ = 0; i_15_ < (this).anIntArray613[i] * 2; i_15_++) {
			Class36.anIntArrayArray618[i][i_15_] = (int) (Class36.aFloatArrayArray617[i][i_15_] * 65536.0F);
		}
		return (this).anIntArray613[i] * 2;
	}

	public final void method356(int i, Class29 class29, Packet packet) {
		int i_16_ = packet.getUByte();
		(this).anIntArray613[0] = i_16_ >> 4;
		while (i >= 0) {
			for (int i_17_ = 1; i_17_ > 0; i_17_++) {
				/* empty */
			}
		}
		(this).anIntArray613[1] = i_16_ & 0xf;
		if (i_16_ != 0) {
			(this).anIntArray616[0] = packet.getUShort();
			(this).anIntArray616[1] = packet.getUShort();
			int i_18_ = packet.getUByte();
			for (int i_19_ = 0; i_19_ < 2; i_19_++) {
				for (int i_20_ = 0; i_20_ < (this).anIntArray613[i_19_]; i_20_++) {
					(this).anIntArrayArrayArray614[i_19_][0][i_20_] = packet.getUShort();
					(this).anIntArrayArrayArray615[i_19_][0][i_20_] = packet.getUShort();
				}
			}
			for (int i_21_ = 0; i_21_ < 2; i_21_++) {
				for (int i_22_ = 0; i_22_ < (this).anIntArray613[i_21_]; i_22_++) {
					if ((i_18_ & 1 << i_21_ * 4 << i_22_) != 0) {
						(this).anIntArrayArrayArray614[i_21_][1][i_22_] = packet
							.getUShort();
						(this).anIntArrayArrayArray615[i_21_][1][i_22_] = packet
							.getUShort();
					} else {
						(this).anIntArrayArrayArray614[i_21_][1][i_22_] = ((this).anIntArrayArrayArray614[i_21_][0][i_22_]);
						(this).anIntArrayArrayArray615[i_21_][1][i_22_] = ((this).anIntArrayArrayArray615[i_21_][0][i_22_]);
					}
				}
			}
			if (i_18_ != 0 || ((this).anIntArray616[1] != (this).anIntArray616[0])) {
				class29.method309(packet, 0);
			}
		} else {
			(this).anIntArray616[0] = (this).anIntArray616[1] = 0;
		}
	}
}
